﻿<UserControl x:Class="Blackbird.Studio.View.EditableLayeredMapView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:view="clr-namespace:Blackbird.Studio.View" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"
             DataContext="{Binding Source={StaticResource ResourceKey=StaticViewModel}, Path=Instance.EditableLayeredMapViewModel}">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <ListBox ItemsSource="{Binding ViewModels}">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Border Style="{StaticResource ToolsBorderStyle}" >
                        <TextBlock Name="DisplayNameTextBlock" Text="{Binding DisplayName}" HorizontalAlignment="Stretch"  />
                    </Border>
                    <DataTemplate.Triggers>
                        <DataTrigger Binding="{Binding Path=IsSelected, Mode=TwoWay}" Value="True">
                            <Setter TargetName="DisplayNameTextBlock" Property="FontWeight" Value="Bold" />
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
            </ListBox.ItemTemplate>
            <ListBox.ItemContainerStyle>
                <Style TargetType="ListBoxItem">
                    <Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}" />
                </Style>
            </ListBox.ItemContainerStyle>
        </ListBox>
        <Border Grid.Column="1" BorderThickness="2" CornerRadius="2" >
            <view:EditableMapLayerView x:Name="SelectedEditableMapLayerView" DataContext="{Binding SelectedItem}"  />
        </Border>
    </Grid>
</UserControl>